home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************************
- *
- * Procedure file: DRAGDROP.PRG
- * System: GenScrnX
- * Version: 1.0
- * Author: Ken R. Levy
- * Company: Jet Propulsion Laboratory
- * Copyright: None (Public Domain)
- *
- ***************************************************************************
- *
- * DRAGDROP - Drag and drop driver.
- *
- * Description:
- * This program is used as an optional driver for use with GENSCRNX.PRG.
- *
- * Features:
- * Generates function dp_lookup for drag and drop lookup.
- *
- * Notes:
- * In this program, for clarity/readability reasons, variable names
- * are used that are longer than 10 characters. Note, however, that only
- * the first 10 characters are significant.
- *
- * Important:
- * Function calls made from this program may be contained in GENSCRNX.PRG.
- * Variable names not declared PRIVATE in this program defined PRIVATE in
- * GENSCRNX.PRG.
- *
- PRIVATE m.codedata,m.fnctname
-
- * Ignore for header record or driver disable mode.
- IF OBJTYPE#1.OR..NOT.drvenable(PROGRAM())
- GOTO BOTTOM
- RETURN .F.
- ENDIF
-
- * Verify that the a window name has been defined in the Screen Layout.
- IF EMPTY(NAME)
- =warning("Driver '"+PROGRAM()+"' requires ["+ALLTRIM(m.platform_)+;
- "] screen name to be defined")
- GOTO BOTTOM
- RETURN .F.
- ENDIF
-
- * Create line of code for function.
- m.codedata='FUNCTION dp_lookup'+m.cr_lf+'PARAMETERS m.m_row,m.m_col,m.objmsg'+;
- m.cr_lf+'PRIVATE m.m_row,m.m_col,m.objmsg'+m.cr_lf+m.cr_lf
-
- IF m.codedata$PROCCODE
- GOTO BOTTOM
- RETURN .F.
- ENDIF
-
- SCAN REST FOR .NOT.wordsearch('*:OBJEXE')==m.null
- m.fnctname=wordsearch(m.c_function)
- IF m.fnctname=m.null.OR.EMPTY(m.fnctname)
- LOOP
- ENDIF
- m.codedata=m.codedata+'IF BETWEEN(m.m_row,'+ALLTRIM(STR(VPOS,7,3))+','+;
- ALLTRIM(STR(VPOS+HEIGHT,7,3))+').AND.BETWEEN(m.m_col,'+;
- ALLTRIM(STR(HPOS,7,3))+','+ALLTRIM(STR(HPOS+WIDTH,7,3))+')'+m.cr_lf+;
- ' RETURN '+m.fnctname+'(m.objmsg)'+m.cr_lf+'ENDIF'+m.cr_lf
- ENDSCAN
-
- m.codedata=m.codedata+'RETURN .F.'+m.cr_lf
- LOCATE FOR OBJTYPE=1
- REPLACE PROCCODE WITH PROCCODE+m.cr_lf+m.codedata
-
- * Go to bottom of .SCX database to have GENSCRNX skip calling this driver
- * for every non-header record.
- GOTO BOTTOM
-
- RETURN .T.
-